1. Field of the Invention
This invention relates to microprocessor systems. In particular, the invention relates to data type checking using a tagged array architecture.
2. Description of Related Art
Specific implementations of high performance microprocessors tend to exploit the particular design aspects in order to achieve high performance or other design objectives. These implementations usually involve different internal data representations. The incompatibility of the internal data representations between different implementations causes many problems including incorrect and/or unexpected results.
One of the basic internal representations is the data type of the operands in an operation or instruction. Typical operations or instructions involve two source operands and a destination operand. To maintain consistency of the representation, the types of data at four localities have to match. These localities include the operation itself, the two source operands, and the destination operand. In addition to the data type, the size of the operand is also important. For example, a double-precision floating-point operation expects the two source operands and the destination operand to be represented in a 64-bit floating-point number format. A type or size mismatch is an indication of some kind of error, such as incorrect parameters, programming mistake, etc.
Type checking of data can be enforced through a number of methods. One method is to associate a specific set of registers of predetermined type and size for a predetermined set of instructions. For example, floating-point instructions can only access floating-point registers. The disadvantages of this method include the use of large silicon area for implementing the pre-assigned registers. Another method is the use of compilers to check for data types. The compiler method, however, involves a high overhead for testing data values and results in lower performance. In addition, not all compilers are compatible; therefore, a program that works under one operating system may not work under another operating system.
In pipelined and superscalar microprocessors, the problem of type mismatch is even more difficult. In particular, the prefetching of instructions and out-of-order execution render data type tracking difficult. Other problems associated with instruction decoding and execution also create architectural challenges. Some examples of these problems are aliased register sets, instruction retirement, mispredicted branches, and exception processing.
Therefore there is a need in the technology to provide an efficient method to facilitate data type matching.